<cfinclude template="validate.cfm">
<cfif isdefined('form.changepass') AND len(trim(form.password)) GT 0>
  <cfinvoke component="cfcs.common.encryption" method="encryptstring" textstring="#form.password#" returnvariable="enc_pass">
  <cfquery name="qupdate" datasource="#request.dsn#">
    UPDATE core_accounts
	SET pword = '#enc_pass#'
    WHERE id = <cfqueryparam value="#form.id#" cfsqltype="cf_sql_integer">
    </cfquery>
</cfif>
<cfset form.joindate = createdatetime(form.syear, form.smonth, sday, "12", "01", "01")>
<cfinvoke component="cfcs.common.dbqueries" method="updatedata" tablename="core_accounts" wherestring="WHERE id = #form.id#" returnvariable="newid"/>
<cfinvoke component="cfcs.common.shared" method="redirect" msg="Account has been updated." url="index.cfm?c=accounts&a=accounts.view&updateid=#form.id#&disp=#disp#&start=#start#&searchbox=#searchbox#&sortby=#sortby#&sortorder=#sortorder#&viewtype=#viewtype#"  />
